//tinyMCEPopup.requireLangPack();

var FileMgrDialog = {
	init: function(ed) {
		tinyMCEPopup.resizeToInnerSize();
	},
	
//	insert: function(url, name){
//	}

	insertFile: function(fileUrl, fileName, iconUrl) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;
		var html = "<a href=\"" + fileUrl + "\"><img src=\"" + iconUrl + "\" alt=\"\"/>" + fileName + "</a>";
		tinyMCEPopup.execCommand('mceInsertContent', false, html);
	},
	
	insertImage: function(url, name) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;
		var html = "<a href=\"" + url + "\"><img src=\"" + url + "\" alt=\"" + name + "\" width=\"150px\"/></a>";
		tinyMCEPopup.execCommand('mceInsertContent', false, html);
	},
	
	closePopup: function() {
		tinyMCEPopup.close();
	}
};

if (tinyMCEPopup && tinyMCEPopup.onInit)
	tinyMCEPopup.onInit.add(FileMgrDialog.init, FileMgrDialog);